package com.framework.exception;

import com.framework.exception.menu.RespCode;

/**
 * 自定义异常,不回滚
 * @author wq
 * @date 2019/10/18 11:04
 * @description
 */
public class NoRollBackException extends RuntimeException{

    private static final long serialVersionUID = 1L;

    private String msg;
    private String code;

    public NoRollBackException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public NoRollBackException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public NoRollBackException(String code, String msg) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public NoRollBackException(String msg, String code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public NoRollBackException(RespCode respCode, Throwable e) {
        super(respCode.getMsg(),e);
        this.code = respCode.getCode();
    }

    public NoRollBackException(RespCode respCode) {
        super(respCode.getMsg());
        this.code = respCode.getCode();
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
